export function getParent(name: string) {
  let parent = this.$parent
  if (parent) {
    let parentName = parent.$options.name
    while (parentName !== name) {
      parent = parent.$parent
      if (parent) {
        parentName = parent.$options.name
      }
      else {
        return null
      }
    }
    return parent
  }
  return null
}
